Implement constraints TuRBO in optimizers#191
Merged
Conversation
Introduced new TuRBO-based generator options in PREDEFINED_GENERATORS and implemented the _make_bayes_turbo helper for flexible trust region configuration. This enables more advanced Bayesian optimization strategies with customizable trust region parameters.
Introduces constraints on total_counts and emittance_proxy in the optimizer config and updates the HiResMagCam evaluator to extract, cache, and return these metrics alongside the objective value. Also changes the generator name in the config to bayes_turbo_HTU_e_beam_brightness.
Changed the number of initialization steps from 3 to 1 in the ScanStepExecutor class to streamline the initialization process before step generation.
Introduced move_devices_parallel_by_device to set device variables in parallel using threads, improving scan step execution speed. The method groups variables by device, sets them with retries and tolerance checks, and replaces the previous sequential move_devices call in execute_step.
Deleted the unused variable 'd' from the _make_bayes_turbo function in generator_factory.py to clean up the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR adds a tested implementation of a turbo controller for bayes optimization. New named generator example.
Also: new method in ScanExecutor to create threads for executing set commands during a scan. Now, each device has it's own thread and set commands can happen in parallel. Significant speed up for multi device optimization scans.
Some initial work at cleaning up how values from ImageAnalysis are tracked an used in optimizers. Still more to do on this front